/**
 * 
 */
package org.xtense.tests;

import org.xtense.model.CAttribute;
import org.xtense.model.CDocument;
import org.xtense.model.CElement;
import org.xtense.model.CSubSet;
import org.xtense.model.CText;

/**
 * @author Owner
 *
 */
public class ModelTest {

	public static void main(String[] args) throws Exception {
		CSubSet cDoc = new CDocument("xx.xml"); 
		
		CElement store = new CElement(1,"store",0);
		CElement book1 = new CElement(2,"book",1);
		CElement book2 = new CElement(4,"book",1);
		CElement author = new CElement(3,"author",2);
		cDoc.addElement(store);
		cDoc.addElement(book1);
		cDoc.addElement(book2);
		cDoc.addElement(author);
		
		CAttribute att= new CAttribute(4,"pub","u guess");
		cDoc.addAttribute(att);
		
		CText text = new CText(3,"me");
		cDoc.addText(text);
		
		cDoc.prettyWrite();
		
		CSubSet cSub = new CSubSet(1);
		cSub.addElement(book1);
		cSub.addElement(book2);
		cSub.addElement(author);
		
		cSub.addAttribute(att);
		
		cSub.addText(text);
		
		cSub.prettyWrite();
		
	}

}
